/**
 * QueryParamBean.java
 * Version 1.0.0
 * Created on 2019年1月17日
 *
 */
package com.yincheng.oes.business.student;

import java.util.ArrayList;
import java.util.List;

import org.apache.commons.lang3.StringUtils;

import com.yincheng.oes.business.util.Page;

/**
 * @author yangsy
 * @version 1.0.0
 * @since
 * 创建时间：2019年1月17日
 * <p>
 * 功能描述：
 * <p>
 * 邮箱地址：446948434@qq.com
 */
public class QueryParamBean {

    private String userAccount;// 学生账号

    private String userName;// 学生姓名

    private String telephone;// 手机号 助教暂时无法修改

    private String groupId;// 班级id

    private Page page;

    private String userId;

    /**
     * 助教id
     */
    private String assistantId;

    /**
     * 助教name
     */
    private String assistantName;

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getAssistantId() {
        return assistantId;
    }

    public void setAssistantId(String assistantId) {
        this.assistantId = assistantId;
    }

    public String getAssistantName() {
        if (StringUtils.isNotEmpty(assistantName)) {
            return assistantName.trim();
        }
        return null;
    }

    public void setAssistantName(String assistantName) {
        this.assistantName = assistantName;
    }

    /**
     * @return the userAccount
     */
    public String getUserAccount() {
        return userAccount;
    }

    /**
     * @param userAccount the userAccount to set
     */
    public void setUserAccount(String userAccount) {
        this.userAccount = userAccount;
    }

    /**
     * @return the userName
     */
    public String getUserName() {
        if (StringUtils.isNotEmpty(userName)) {
            return userName.trim();
        }
        return null;
    }

    /**
     * @param userName the userName to set
     */
    public void setUserName(String userName) {
        this.userName = userName;
    }

    /**
     * @return the telephone
     */
    public String getTelephone() {
        return telephone;
    }

    /**
     * @param telephone the telephone to set
     */
    public void setTelephone(String telephone) {
        this.telephone = telephone;
    }

    /**
     * @return the page
     */
    public Page getPage() {
        return page;
    }

    /**
     * @param page the page to set
     */
    public void setPage(Page page) {
        this.page = page;
    }

    /**
     * @return the groupId
     */
    public String getGroupId() {
        return groupId;
    }

    /**
     * @param groupId the groupId to set
     */
    public void setGroupId(String groupId) {
        this.groupId = groupId;
    }

    public String[] getUserAccounts() {
        String[] split = StringUtils.split(StringUtils.defaultIfBlank(userAccount, ""));
        List<String> newParams = new ArrayList<String>();
        for (String string : split) {
            string = "%" + string + "%";
            newParams.add(string);
        }
        return (String[]) newParams.toArray(new String[0]);
    }

    public String[] getUserNames() {
        String[] split = StringUtils.split(StringUtils.defaultIfBlank(userName, ""));
        List<String> newParams = new ArrayList<String>();
        for (String string : split) {
            string = "%" + string + "%";
            newParams.add(string);
        }
        return (String[]) newParams.toArray(new String[0]);
    }

    public String[] getTelephones() {
        String[] split = StringUtils.split(StringUtils.defaultIfBlank(telephone, ""));
        List<String> newParams = new ArrayList<String>();
        for (String string : split) {
            string = "%" + string + "%";
            newParams.add(string);
        }
        return (String[]) newParams.toArray(new String[0]);
    }
}
